<template>
	<div>
		<p>测试使用特殊属性is</p>
		<div>动态组件使用is属性与component配合使用</div>
		<button @click="ChangeShow">切换组件</button>
		<!-- <SonA v-if="isShow" /><SonB v-else /> -->
		<component :is="showComponent" />
	</div>
</template>
<script>
import SonA from "./SonA.vue";
import SonB from "./SonB.vue";
export default {
	name: "",
	// components: { SonA, SonB },
	data() {
		return {
			isShow: true,
			showComponent: SonA,
		};
	},
	mounted() {},
	methods: {
		ChangeShow() {
			// this.isShow = !this.isShow;
			this.showComponent = SonB;
		},
	},
};
</script>
<style lang="" scoped></style>
